package com.example.invoke.listener;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class CommonListener implements ApplicationListener {

    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        if (event instanceof CommonEvent) {
            CommonEvent commonEvent = (CommonEvent) event;
            System.out.println(commonEvent.toString());
        }
    }
}
